/*
 * MenuBar.java
 *
 * @author Michael Hansen
 * @author Lukas Thuernagel
 * @author Soeren Warszus
 */

package risk.game;

import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class MenuBar extends JMenuBar
{
    private ActionListener actionListener;
    
    public MenuBar(ActionListener actionListener)
    {
        this.actionListener = actionListener;
        createFileMenu();
    }
    
    /**
     * Erstellt das Menue "Datei"
     */
    private void createFileMenu() {
        JMenu menu = new JMenu("Datei");
        add(menu);
        addMenuItem(menu, "Neu", "New");
        
        
       
    }
    
    /**
     * Fuegt einen Untermenuepunkt zum Menue hinzu.
     */
    private void addMenuItem(JMenu menu, String name, String action) {
        
        JMenuItem menuItem = new JMenuItem(name);
        menuItem.setActionCommand(action);
        menuItem.addActionListener(actionListener);
        menu.add(menuItem);
    }
}